<?php
require("../model/getdata.php");
class controller{
	private $result;
	public function GetData($params){
		$sqldata=new getdata();
		$sql="select * from ".$params['table_name'];
		return $this->result=$sqldata->SelectSql($sql);
	}
	
	public function InsertData($params){
		$sqldata=new getdata();
		$sql = "insert into author values (".$params['id'].",".$params['lastname'].",".$params['firstname'].",".$params['addresss'].",".$params['city'].")";
		return $this->result=$sqldata->ExecSql($sql);
	}

	public function DeleteData($params){
		$sqldata=new getdata();
		$sql="delete from author where id= ".$params['id'];
		return $this->result=$sqldata->ExecSql($sql);
	}

	public function getResult(){
		return $this->result;
	}
}
?>